{{ $enableTableContents := .Site.Params.enableTableContents }}
{{ $tocField := default "toc" .Site.Params.tocField }}
{{ $paramToc := default "true" (index .Params $tocField) }}
{{if and $enableTableContents $paramToc }}
    <div class="col-12 col-md-4 col-lg-4 order-md-2" id="sidebarToc">
        <div class="blog-sidebar">
            <div class="blog-sidebar-section -table-of-contents card">
                <div class="center-line-title">
                    <h5>{{ T `post-toc` }}</h5>
                </div>
                <div class="toc">
                    {{ .TableOfContents }}
                </div>
            </div>
        </div>
    </div>  
{{ end }}
<div class="col-12  {{if and $enableTableContents $paramToc }} col-md-8 col-lg-8 order-md-1 {{end}}" id="postContent">
    <div class="row">
        <div class="post col-12" id="post">
            <div class="post-standard card">
                <div class="row">
                    <div class="col-12 order-md-2">
                        <div class="post-standard__content">
                            <h1 class="center">{{ .Title }}</h1>
                            <div class="content_info">
                                <p>
                                    <span title="{{ T `authors-title` }}"> <i class="iconfont icon-users"></i>{{ T `post-authors` }}：{{ with .Params.authors }}{{ delimit . "," }}{{ else }}{{- .Site.Params.authors -}}{{ end }}</span> 
                                    <span title="{{ T `publishDate-title` }}"><i class="iconfont icon-calendar"></i>{{ T `post-publishDate` }}：{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}} </span>
                                    <span title="{{ T `readingTime-title` }}"><i class="iconfont icon-clock"></i>{{ T `post-reading` }}：{{- .ReadingTime -}}{{ T `readingTime-unit` }}</span>
                                    <span title="{{ T `post-uv-title` }}"><i class="iconfont icon-views"></i>{{ T `post-uv` }}：<span id="busuanzi_value_page_pv"></span></span>
                                </p>
                            </div>

                            {{ $fromField := default "from" .Site.Params.fromField }}
                            {{ $fromSrc := index .Params $fromField  }}

                            {{ if $fromSrc }}
                                <div class="content-src">
                                   <i class="iconfont icon-sources"></i>{{ T `post-from` }}：<a href="{{ $fromSrc }} ">{{ $fromSrc }}</a>
                                </div>
                            {{ end  }}

                            {{ with .Param "description" }}
                            <div class="content_quote" title="{{ T `post-abstract` }}">
                                <i class="iconfont icon-quote"></i> <quote>{{ . }}</quote>
                            </div>
                            {{ end }}
                            {{ $image := partialCached "utils/image.html" (dict "Context" . ) . }}
                            {{ if $image.exists }}
                            <figure>
                                <div class="content-image" data-src="{{$image.permalink}}" data-sub-html="{{ .Title }}">
                                    <img src="{{$image.permalink}}" alt="{{ .Title }}" />
                                </div>
                            </figure>
                            {{end }}
                            <!-- post content -->
                            {{ .Content }}
                            <div class="post-footer">
                                {{ with .Params.tags }}
                                <div class="post-footer__tags" title="{{ T `tag-title` }}">
                                    <i class="iconfont icon-tags"></i>
                                    {{ range . }}
                                    <a href="/tags{{ . | relURL }}">{{ . }}</a> 
                                    {{ end }}
                                </div>
                                {{ end }}
                                
                                <!-- Related Posts -->
                                <div class="post-footer__related">
                                    {{ with .Prev }}
                                    <div class="post-footer__related__item -prev ">
                                        <div class="post-footer__related__item__content">
                                            {{/*{{ T `post-prev` }}*/}}
                                            <div class="post-card ">
                                                <div class="card__content">
                                                    <a class="card__content-title" href="{{ .RelPermalink | relURL }}"><i class="iconfont icon-left"></i>{{ .Title }}</a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    {{end}} {{ with .Next }}
                                    <div class="post-footer__related__item -next center">
                                        <div class="post-footer__related__item__content">
                                            {{/*{{ T `post-next` }}*/}}
                                            <div class="post-card -right">
                                                <div class="card__content">
                                                    <a class="card__content-title" href="{{ .RelPermalink | relURL }}">{{ .Title }}<i class="iconfont icon-right"></i></a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    {{ end }}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            {{ partial "plugins/comments/comment.html" . }}
        </div>
    </div>
</div>
{{ partial "plugins/gallery/index.html" . }}